<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/3 0003
 * Time: 下午 5:22
 */
namespace app\admin\controller;


use think\Controller;
use app\admin\model\AdminUser;

class Login extends Controller{
    public function index(){
        if(request()->isPost()){
            $data = input('post.');
            $model = new AdminUser();
            try{
                $model->login($data);
            }catch (\Exception $e){
                $this->error($e->getMessage());
            }

        }else{
            return $this->fetch();
        }

    }


}